/**
 * 混入 vue
 */
import {
	mapState
} from 'vuex';
import store from "@/store"

export default {
	created() {
		uni.$u.vuex = (name, value) => {
			this.$store.commit('$uStore', {
				name,
				value
			});
			if (store.state.$saveName.indexOf(name) > -1) {
				uni.setStorageSync(name, value);
			}
		}
	},
	computed: {
		...mapState(store.state ? Object.keys(store.state) : [])
	},
}
